(define (domain marsexplorer-planning)

(:requirements :typing :action-costs)
(:types agent food wall mothership position)

(:predicates
    (agent-at ?a - agent ?p - position)
    (food-at ?f - food ?p - position)
    (food-with ?f - food ?a - agent)
    (has-food ?a - agent)
    (not-has-food ?a - agent)
    (mothership-at ?p - position)
    (not-mothership-at ?p - position)
    (wall-at ?p - position)
    (not-wall-at ?p - position)
    (food-here ?p - position)
    (not-food-here ?p - position)
    (adjacent-positions ?p1 ?p2 - position)
    (food-processed ?f - food)
    (not-food-processed ?f - food)
    (food-consumed ?f - food)
    (done)
    (not-done)
    (decrease-energy-by-1)
    (not-decrease-energy-by-1)
    (decrease-energy-by-2)
    (not-decrease-energy-by-2)
    (increase-energy)
    (not-increase-energy)
    (energy-level-0)
    (not-energy-level-0)
    (energy-level-1)
    (not-energy-level-1)
    (energy-level-2)
    (not-energy-level-2)
    (energy-level-3)
    (not-energy-level-3)
    (energy-level-4)
    (not-energy-level-4)
    (energy-level-5)
    (not-energy-level-5)
    (energy-level-6)
    (not-energy-level-6)
    (energy-level-7)
    (not-energy-level-7)
    (energy-level-8)
    (not-energy-level-8)
    (energy-level-9)
    (not-energy-level-9)
    (energy-level-10)
    (not-energy-level-10)
    (energy-level-11)
    (not-energy-level-11)
    (energy-level-12)
    (not-energy-level-12)
    (energy-level-13)
    (not-energy-level-13)
    (energy-level-14)
    (not-energy-level-14)
    (energy-level-15)
    (not-energy-level-15)
    (energy-level-16)
    (not-energy-level-16)
    (energy-level-17)
    (not-energy-level-17)
    (energy-level-18)
    (not-energy-level-18)
    (energy-level-19)
    (not-energy-level-19)
    (energy-level-20)
    (not-energy-level-20)
    (energy-level-21)
    (not-energy-level-21)
    (energy-level-22)
    (not-energy-level-22)
    (energy-level-23)
    (not-energy-level-23)
    (energy-level-24)
    (not-energy-level-24)
    (energy-level-25)
    (not-energy-level-25)
    (energy-level-26)
    (not-energy-level-26)
    (energy-level-27)
    (not-energy-level-27)
    (energy-level-28)
    (not-energy-level-28)
    (energy-level-29)
    (not-energy-level-29)
    (energy-level-30)
    (not-energy-level-30)
    )

(:functions
    (total-cost) - number
    )
    
;;; An agent moves while not holding anything (lower cost).
(:action move-unladen
    :parameters     (?a - agent ?from ?to - position)
    :precondition   (and (not-done)
                         (agent-at ?a ?from)
                         (not-has-food ?a)
                         (not-wall-at ?to)
                         (adjacent-positions ?from ?to)
                         (not-energy-level-0)
                         (not-decrease-energy-by-1)
                         (not-decrease-energy-by-2)
                         (not-increase-energy))
    :effect         (and (increase (total-cost) 1)
                         (decrease-energy-by-1)
                         (not (not-decrease-energy-by-1))
                         (not (agent-at ?a ?from))
                         (agent-at ?a ?to))
    )

;;; An agent moves while holding food (higher cost).
(:action move-laden
    :parameters     (?a - agent ?from ?to - position)
    :precondition   (and (not-done)
                         (agent-at ?a ?from)
                         (has-food ?a)
                         (not-wall-at ?to)
                         (adjacent-positions ?from ?to)
                         (not-energy-level-0)
                         (not-energy-level-1)
                         (not-decrease-energy-by-1)
                         (not-decrease-energy-by-2)
                         (not-increase-energy))
    :effect         (and (increase (total-cost) 1)
                         (decrease-energy-by-2)
                         (not (not-decrease-energy-by-2))
                         (not (agent-at ?a ?from))
                         (agent-at ?a ?to))
    )

;;; An agent can pick up food if it's not already holding one.
;;; A food that is already at the mothership cannot picked up again.
(:action pick-up-food
    :parameters     (?a - agent ?f - food ?where - position)
    :precondition   (and (not-done)
                         (agent-at ?a ?where)
                         (food-at ?f ?where)
                         (food-here ?where)
                         (not-mothership-at ?where)
                         (not-has-food ?a)
                         (not-decrease-energy-by-1)
                         (not-decrease-energy-by-2)
                         (not-increase-energy))
    :effect         (and (increase (total-cost) 1)
                         (has-food ?a)
                         (not (not-has-food ?a))
                         (food-with ?f ?a)
                         (not (food-at ?f ?where))
                         (not (food-here ?where))
                         (not-food-here ?where))
    )

;;; An agent can drop food it's holding, if there is no other food at the position.
;;; Exception: At the mothership, many foods can be dropped
(:action drop-food
    :parameters     (?a - agent ?f - food ?where - position)
    :precondition   (and (not-done)
                         (agent-at ?a ?where)
                         (food-with ?f ?a)
                         (has-food ?a)
                         (or (mothership-at ?where)
                             (not-food-here ?where))
                         (not-decrease-energy-by-1)
                         (not-decrease-energy-by-2)
                         (not-increase-energy))
    :effect         (and (increase (total-cost) 1)
                         (not (food-with ?f ?a))
                         (not (has-food ?a))
                         (not-has-food ?a)
                         (food-at ?f ?where)
                         (food-here ?where)
                         (not (not-food-here ?where)))
    )

;;; An agent can eat food it's holding to increase its energy level.
;;; IMPORTANT: mark the food as consumed, else the agent can never fulfil the goal after consuming any food!
(:action eat-food
    :parameters     (?a - agent ?f - food)
    :precondition   (and (not-done)
                         (has-food ?a)
                         (food-with ?f ?a)
                         (not-decrease-energy-by-1)
                         (not-decrease-energy-by-2)
                         (not-increase-energy))
    :effect         (and (increase (total-cost) 1)
                         (not (has-food ?a))
                         (not-has-food ?a)
                         (not (food-with ?f ?a))
                         (increase-energy)
                         (not (not-increase-energy))
                         (food-consumed ?f))
    )

;;; Action to signal the end of agent operations and commencement of tidy-up operations.
(:action stop-operations
    :precondition   (and (not-done)
                         (not-decrease-energy-by-1)
                         (not-decrease-energy-by-2)
                         (not-increase-energy)
                         (not-has-food a0))
    :effect         (and (increase (total-cost) 1)
                         (done)
                         (not (not-done)))
    )

;;; Action at end: Reward for collected food.
(:action tidyup-at-mothership
    :parameters      (?f - food ?where - position)
    :precondition   (and (done)
                         (food-at ?f ?where)
                         (food-here ?where)
                         (mothership-at ?where)
                         (not-food-processed ?f))
    :effect         (and (increase (total-cost) 1)
                         (not (food-at ?f ?where))
                         (not (food-here ?where))
                         (not-food-here ?where)
                         (food-processed ?f)
                         (not (not-food-processed ?f)))
    )

;;; Action at end: Punishment for uncollected/consumed food.
(:action tidyup-in-field
    :parameters      (?f - food ?where - position)
    :precondition   (or (and (done)
                             (food-consumed ?f))
                        (and (done)
                             (food-at ?f ?where)
                             (food-here ?where)
                             (not-food-processed ?f)))
    :effect         (and (increase (total-cost) 1)
                         (not (food-at ?f ?where))
                         (not (food-here ?where))
                         (not-food-here ?where)
                         (food-processed ?f)
                         (not (not-food-processed ?f))
                         (increase (total-cost) 30))
    )

;;; Actions to increase/decrease the energy level

(:action decrease-energy-by-1-from-1
    :precondition (and (decrease-energy-by-1)
                       (energy-level-1))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-1))
                       (not-energy-level-1)
                       (energy-level-0)
                       (not (not-energy-level-0)))
    )

(:action decrease-energy-by-1-from-2
    :precondition (and (decrease-energy-by-1)
                       (energy-level-2))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-2))
                       (not-energy-level-2)
                       (energy-level-1)
                       (not (not-energy-level-1)))
    )

(:action decrease-energy-by-1-from-3
    :precondition (and (decrease-energy-by-1)
                       (energy-level-3))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-3))
                       (not-energy-level-3)
                       (energy-level-2)
                       (not (not-energy-level-2)))
    )

(:action decrease-energy-by-1-from-4
    :precondition (and (decrease-energy-by-1)
                       (energy-level-4))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-4))
                       (not-energy-level-4)
                       (energy-level-3)
                       (not (not-energy-level-3)))
    )

(:action decrease-energy-by-1-from-5
    :precondition (and (decrease-energy-by-1)
                       (energy-level-5))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-5))
                       (not-energy-level-5)
                       (energy-level-4)
                       (not (not-energy-level-4)))
    )

(:action decrease-energy-by-1-from-6
    :precondition (and (decrease-energy-by-1)
                       (energy-level-6))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-6))
                       (not-energy-level-6)
                       (energy-level-5)
                       (not (not-energy-level-5)))
    )

(:action decrease-energy-by-1-from-7
    :precondition (and (decrease-energy-by-1)
                       (energy-level-7))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-7))
                       (not-energy-level-7)
                       (energy-level-6)
                       (not (not-energy-level-6)))
    )

(:action decrease-energy-by-1-from-8
    :precondition (and (decrease-energy-by-1)
                       (energy-level-8))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-8))
                       (not-energy-level-8)
                       (energy-level-7)
                       (not (not-energy-level-7)))
    )

(:action decrease-energy-by-1-from-9
    :precondition (and (decrease-energy-by-1)
                       (energy-level-9))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-9))
                       (not-energy-level-9)
                       (energy-level-8)
                       (not (not-energy-level-8)))
    )

(:action decrease-energy-by-1-from-10
    :precondition (and (decrease-energy-by-1)
                       (energy-level-10))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-10))
                       (not-energy-level-10)
                       (energy-level-9)
                       (not (not-energy-level-9)))
    )

(:action decrease-energy-by-1-from-11
    :precondition (and (decrease-energy-by-1)
                       (energy-level-11))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-11))
                       (not-energy-level-11)
                       (energy-level-10)
                       (not (not-energy-level-10)))
    )

(:action decrease-energy-by-1-from-12
    :precondition (and (decrease-energy-by-1)
                       (energy-level-12))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-12))
                       (not-energy-level-12)
                       (energy-level-11)
                       (not (not-energy-level-11)))
    )

(:action decrease-energy-by-1-from-13
    :precondition (and (decrease-energy-by-1)
                       (energy-level-13))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-13))
                       (not-energy-level-13)
                       (energy-level-12)
                       (not (not-energy-level-12)))
    )

(:action decrease-energy-by-1-from-14
    :precondition (and (decrease-energy-by-1)
                       (energy-level-14))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-14))
                       (not-energy-level-14)
                       (energy-level-13)
                       (not (not-energy-level-13)))
    )

(:action decrease-energy-by-1-from-15
    :precondition (and (decrease-energy-by-1)
                       (energy-level-15))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-15))
                       (not-energy-level-15)
                       (energy-level-14)
                       (not (not-energy-level-14)))
    )

(:action decrease-energy-by-1-from-16
    :precondition (and (decrease-energy-by-1)
                       (energy-level-16))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-16))
                       (not-energy-level-16)
                       (energy-level-15)
                       (not (not-energy-level-15)))
    )

(:action decrease-energy-by-1-from-17
    :precondition (and (decrease-energy-by-1)
                       (energy-level-17))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-17))
                       (not-energy-level-17)
                       (energy-level-16)
                       (not (not-energy-level-16)))
    )

(:action decrease-energy-by-1-from-18
    :precondition (and (decrease-energy-by-1)
                       (energy-level-18))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-18))
                       (not-energy-level-18)
                       (energy-level-17)
                       (not (not-energy-level-17)))
    )

(:action decrease-energy-by-1-from-19
    :precondition (and (decrease-energy-by-1)
                       (energy-level-19))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-19))
                       (not-energy-level-19)
                       (energy-level-18)
                       (not (not-energy-level-18)))
    )

(:action decrease-energy-by-1-from-20
    :precondition (and (decrease-energy-by-1)
                       (energy-level-20))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-20))
                       (not-energy-level-20)
                       (energy-level-19)
                       (not (not-energy-level-19)))
    )

(:action decrease-energy-by-1-from-21
    :precondition (and (decrease-energy-by-1)
                       (energy-level-21))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-21))
                       (not-energy-level-21)
                       (energy-level-20)
                       (not (not-energy-level-20)))
    )

(:action decrease-energy-by-1-from-22
    :precondition (and (decrease-energy-by-1)
                       (energy-level-22))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-22))
                       (not-energy-level-22)
                       (energy-level-21)
                       (not (not-energy-level-21)))
    )

(:action decrease-energy-by-1-from-23
    :precondition (and (decrease-energy-by-1)
                       (energy-level-23))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-23))
                       (not-energy-level-23)
                       (energy-level-22)
                       (not (not-energy-level-22)))
    )

(:action decrease-energy-by-1-from-24
    :precondition (and (decrease-energy-by-1)
                       (energy-level-24))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-24))
                       (not-energy-level-24)
                       (energy-level-23)
                       (not (not-energy-level-23)))
    )

(:action decrease-energy-by-1-from-25
    :precondition (and (decrease-energy-by-1)
                       (energy-level-25))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-25))
                       (not-energy-level-25)
                       (energy-level-24)
                       (not (not-energy-level-24)))
    )

(:action decrease-energy-by-1-from-26
    :precondition (and (decrease-energy-by-1)
                       (energy-level-26))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-26))
                       (not-energy-level-26)
                       (energy-level-25)
                       (not (not-energy-level-25)))
    )

(:action decrease-energy-by-1-from-27
    :precondition (and (decrease-energy-by-1)
                       (energy-level-27))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-27))
                       (not-energy-level-27)
                       (energy-level-26)
                       (not (not-energy-level-26)))
    )

(:action decrease-energy-by-1-from-28
    :precondition (and (decrease-energy-by-1)
                       (energy-level-28))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-28))
                       (not-energy-level-28)
                       (energy-level-27)
                       (not (not-energy-level-27)))
    )

(:action decrease-energy-by-1-from-29
    :precondition (and (decrease-energy-by-1)
                       (energy-level-29))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-29))
                       (not-energy-level-29)
                       (energy-level-28)
                       (not (not-energy-level-28)))
    )

(:action decrease-energy-by-1-from-30
    :precondition (and (decrease-energy-by-1)
                       (energy-level-30))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-1))
                       (not-decrease-energy-by-1)
                       (not (energy-level-30))
                       (not-energy-level-30)
                       (energy-level-29)
                       (not (not-energy-level-29)))
    )

(:action decrease-energy-by-2-from-2
    :precondition (and (decrease-energy-by-2)
                       (energy-level-2))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-2))
                       (not-energy-level-2)
                       (energy-level-0)
                       (not (not-energy-level-0)))
    )

(:action decrease-energy-by-2-from-3
    :precondition (and (decrease-energy-by-2)
                       (energy-level-3))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-3))
                       (not-energy-level-3)
                       (energy-level-1)
                       (not (not-energy-level-1)))
    )

(:action decrease-energy-by-2-from-4
    :precondition (and (decrease-energy-by-2)
                       (energy-level-4))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-4))
                       (not-energy-level-4)
                       (energy-level-2)
                       (not (not-energy-level-2)))
    )

(:action decrease-energy-by-2-from-5
    :precondition (and (decrease-energy-by-2)
                       (energy-level-5))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-5))
                       (not-energy-level-5)
                       (energy-level-3)
                       (not (not-energy-level-3)))
    )

(:action decrease-energy-by-2-from-6
    :precondition (and (decrease-energy-by-2)
                       (energy-level-6))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-6))
                       (not-energy-level-6)
                       (energy-level-4)
                       (not (not-energy-level-4)))
    )

(:action decrease-energy-by-2-from-7
    :precondition (and (decrease-energy-by-2)
                       (energy-level-7))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-7))
                       (not-energy-level-7)
                       (energy-level-5)
                       (not (not-energy-level-5)))
    )

(:action decrease-energy-by-2-from-8
    :precondition (and (decrease-energy-by-2)
                       (energy-level-8))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-8))
                       (not-energy-level-8)
                       (energy-level-6)
                       (not (not-energy-level-6)))
    )

(:action decrease-energy-by-2-from-9
    :precondition (and (decrease-energy-by-2)
                       (energy-level-9))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-9))
                       (not-energy-level-9)
                       (energy-level-7)
                       (not (not-energy-level-7)))
    )

(:action decrease-energy-by-2-from-10
    :precondition (and (decrease-energy-by-2)
                       (energy-level-10))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-10))
                       (not-energy-level-10)
                       (energy-level-8)
                       (not (not-energy-level-8)))
    )

(:action decrease-energy-by-2-from-11
    :precondition (and (decrease-energy-by-2)
                       (energy-level-11))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-11))
                       (not-energy-level-11)
                       (energy-level-9)
                       (not (not-energy-level-9)))
    )

(:action decrease-energy-by-2-from-12
    :precondition (and (decrease-energy-by-2)
                       (energy-level-12))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-12))
                       (not-energy-level-12)
                       (energy-level-10)
                       (not (not-energy-level-10)))
    )

(:action decrease-energy-by-2-from-13
    :precondition (and (decrease-energy-by-2)
                       (energy-level-13))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-13))
                       (not-energy-level-13)
                       (energy-level-11)
                       (not (not-energy-level-11)))
    )

(:action decrease-energy-by-2-from-14
    :precondition (and (decrease-energy-by-2)
                       (energy-level-14))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-14))
                       (not-energy-level-14)
                       (energy-level-12)
                       (not (not-energy-level-12)))
    )

(:action decrease-energy-by-2-from-15
    :precondition (and (decrease-energy-by-2)
                       (energy-level-15))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-15))
                       (not-energy-level-15)
                       (energy-level-13)
                       (not (not-energy-level-13)))
    )

(:action decrease-energy-by-2-from-16
    :precondition (and (decrease-energy-by-2)
                       (energy-level-16))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-16))
                       (not-energy-level-16)
                       (energy-level-14)
                       (not (not-energy-level-14)))
    )

(:action decrease-energy-by-2-from-17
    :precondition (and (decrease-energy-by-2)
                       (energy-level-17))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-17))
                       (not-energy-level-17)
                       (energy-level-15)
                       (not (not-energy-level-15)))
    )

(:action decrease-energy-by-2-from-18
    :precondition (and (decrease-energy-by-2)
                       (energy-level-18))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-18))
                       (not-energy-level-18)
                       (energy-level-16)
                       (not (not-energy-level-16)))
    )

(:action decrease-energy-by-2-from-19
    :precondition (and (decrease-energy-by-2)
                       (energy-level-19))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-19))
                       (not-energy-level-19)
                       (energy-level-17)
                       (not (not-energy-level-17)))
    )

(:action decrease-energy-by-2-from-20
    :precondition (and (decrease-energy-by-2)
                       (energy-level-20))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-20))
                       (not-energy-level-20)
                       (energy-level-18)
                       (not (not-energy-level-18)))
    )

(:action decrease-energy-by-2-from-21
    :precondition (and (decrease-energy-by-2)
                       (energy-level-21))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-21))
                       (not-energy-level-21)
                       (energy-level-19)
                       (not (not-energy-level-19)))
    )

(:action decrease-energy-by-2-from-22
    :precondition (and (decrease-energy-by-2)
                       (energy-level-22))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-22))
                       (not-energy-level-22)
                       (energy-level-20)
                       (not (not-energy-level-20)))
    )

(:action decrease-energy-by-2-from-23
    :precondition (and (decrease-energy-by-2)
                       (energy-level-23))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-23))
                       (not-energy-level-23)
                       (energy-level-21)
                       (not (not-energy-level-21)))
    )

(:action decrease-energy-by-2-from-24
    :precondition (and (decrease-energy-by-2)
                       (energy-level-24))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-24))
                       (not-energy-level-24)
                       (energy-level-22)
                       (not (not-energy-level-22)))
    )

(:action decrease-energy-by-2-from-25
    :precondition (and (decrease-energy-by-2)
                       (energy-level-25))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-25))
                       (not-energy-level-25)
                       (energy-level-23)
                       (not (not-energy-level-23)))
    )

(:action decrease-energy-by-2-from-26
    :precondition (and (decrease-energy-by-2)
                       (energy-level-26))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-26))
                       (not-energy-level-26)
                       (energy-level-24)
                       (not (not-energy-level-24)))
    )

(:action decrease-energy-by-2-from-27
    :precondition (and (decrease-energy-by-2)
                       (energy-level-27))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-27))
                       (not-energy-level-27)
                       (energy-level-25)
                       (not (not-energy-level-25)))
    )

(:action decrease-energy-by-2-from-28
    :precondition (and (decrease-energy-by-2)
                       (energy-level-28))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-28))
                       (not-energy-level-28)
                       (energy-level-26)
                       (not (not-energy-level-26)))
    )

(:action decrease-energy-by-2-from-29
    :precondition (and (decrease-energy-by-2)
                       (energy-level-29))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-29))
                       (not-energy-level-29)
                       (energy-level-27)
                       (not (not-energy-level-27)))
    )

(:action decrease-energy-by-2-from-30
    :precondition (and (decrease-energy-by-2)
                       (energy-level-30))
    :effect       (and (increase (total-cost) 1)
                       (not (decrease-energy-by-2))
                       (not-decrease-energy-by-2)
                       (not (energy-level-30))
                       (not-energy-level-30)
                       (energy-level-28)
                       (not (not-energy-level-28)))
    )

(:action increase-energy
    :precondition (increase-energy)
    :effect (and (increase (total-cost) 1)
                 (not (increase-energy))
                 (not-increase-energy)
                 (not (energy-level-0))
                 (not-energy-level-0)
                 (not (energy-level-1))
                 (not-energy-level-1)
                 (not (energy-level-2))
                 (not-energy-level-2)
                 (not (energy-level-3))
                 (not-energy-level-3)
                 (not (energy-level-4))
                 (not-energy-level-4)
                 (not (energy-level-5))
                 (not-energy-level-5)
                 (not (energy-level-6))
                 (not-energy-level-6)
                 (not (energy-level-7))
                 (not-energy-level-7)
                 (not (energy-level-8))
                 (not-energy-level-8)
                 (not (energy-level-9))
                 (not-energy-level-9)
                 (not (energy-level-10))
                 (not-energy-level-10)
                 (not (energy-level-11))
                 (not-energy-level-11)
                 (not (energy-level-12))
                 (not-energy-level-12)
                 (not (energy-level-13))
                 (not-energy-level-13)
                 (not (energy-level-14))
                 (not-energy-level-14)
                 (not (energy-level-15))
                 (not-energy-level-15)
                 (not (energy-level-16))
                 (not-energy-level-16)
                 (not (energy-level-17))
                 (not-energy-level-17)
                 (not (energy-level-18))
                 (not-energy-level-18)
                 (not (energy-level-19))
                 (not-energy-level-19)
                 (not (energy-level-20))
                 (not-energy-level-20)
                 (not (energy-level-21))
                 (not-energy-level-21)
                 (not (energy-level-22))
                 (not-energy-level-22)
                 (not (energy-level-23))
                 (not-energy-level-23)
                 (not (energy-level-24))
                 (not-energy-level-24)
                 (not (energy-level-25))
                 (not-energy-level-25)
                 (not (energy-level-26))
                 (not-energy-level-26)
                 (not (energy-level-27))
                 (not-energy-level-27)
                 (not (energy-level-28))
                 (not-energy-level-28)
                 (not (energy-level-29))
                 (not-energy-level-29)
                 (not (not-energy-level-30))
                 (energy-level-30))
    )
)